package com.designpattern.softwaredesignpatternstudy.pdai.observer;

/**
 * @author: Aster
 * @note: 天气数据布告板会在天气信息发生改变时更新其内容，布告板有多个，并且在将来会继续增加。
 * @create: 2025-07-16 16:27
 **/
public class WeatherStation {

    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);
        StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);

        weatherData.setMeasurements(80, 65, 30.4f);
        weatherData.setMeasurements(82, 70, 29.2f);

        weatherData.removeObserver(currentConditionsDisplay);
        weatherData.setMeasurements(78, 90, 29.2f);
    }
}
